home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip: Special Tips & Tricks for Windows 95
/
Chip Wintips.iso
/
zeszyt
/
winbatch
/
boxdemo.wb_
< prev
next >
Wrap
Text File
|
1995-10-09
|
15KB
|
506 lines
IntControl(12,5,0,0,0)
;colors
DKBLUE="0,0,128"
BLUE="0,0,255"
LTGRAY="192,192,192"
GRAY="128,128,128"
DKGRAY="64,64,64"
GREEN="0,255,0"
RED="255,0,0"
BLACK="0,0,0"
WHITE="255,255,255"
YELLOW="255,255,0"
while 1
BoxColor(1,"0,0,128",4)
BoxesUp("100,100,900,900",@NORMAL)
BoxCaption(1,"Boxes, Boxes everywhere, and not a box to think!")
bDraw=1
bLines=2
bBoxes=3
bDots=4
bExit=5
bText=6
bTherm=7
BoxButtonDraw(1,bDraw, "&Draw", "25,10,175,70")
BoxButtonDraw(1,bLines, "&Lines", "225,10,375,70")
BoxButtonDraw(1,bBoxes, "&Boxes", "425,10,575,70")
BoxButtonDraw(1,bDots, "&Spots", "625,10,775,70")
BoxButtonDraw(1,bExit, "E&xit", "825,10,975,70")
BoxButtonDraw(1,bText, "&Text", "25,100,175,160")
BoxButtonDraw(1,bTherm, "Thermo&meter Bar", "225,100,575,160")
BoxDrawRect(1,"0,0,1000,1000",2)
BoxTextFont(1,"",100,0,0)
BoxTextColor(1,"255,255,0")
BoxDrawText(1,"0,0,1000,1000","Pick a Demo",0,5)
bWho=0
BoxButtonWait()
while bWho==0
for x=1 to 7
if BoxButtonStat(1,x) then bWho=x
next
end while
if bWho
BoxDataClear(1,"TOP")
switch bWho
case bDraw
gosub DoDraw
break
case bLines
gosub DoLines
break
case bBoxes
gosub DoBoxes
break
case bDots
gosub DoDots
break
case bExit
exit
break
case bText
gosub DoText
break
case bTherm
gosub DoTherm
break
end switch
endif
end while
exit
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
:DODRAW
BoxCaption(1,"Scribble")
BoxNew(2,"0,0,1000,1000",0)
BoxPen(2,RED,1)
BoxButtonDraw(2,8,"Exit","50,50,200,120")
BoxDataTag(2,"FRED")
Exclusive(@ON)
olda="500,500"
while 1
BoxDataClear(2,"FRED")
a=MouseInfo(6)
a=strreplace(a," ",",")
BoxDrawLine(2,"%olda%,%a%")
olda=a
if BoxButtonStat(2,8)==1 then break
endwhile
BoxDestroy(2)
return
:DOLINES
BoxCaption(1,"That Old Line")
BoxNew(2,"0,0,1000,1000",0)
BoxColor(2,BLACK,0)
BoxDrawRect(2,"0,0,1000,1000",2)
BoxButtonDraw(2,8,"Exit","50,50,200,120")
BoxDataTag(2,"APPLE")
p1=200
p2=200
p3=400
p4=400
v1=10
v2=-20
v3=-5
v4=15
bb=1
ErrorMode(@OFF)
while 1
if BoxButtonStat(2,8)==1 then break
if LastError()==10108
BoxDataClear(2,"APPLE")
BoxPen(2,"%r%,%g%,%b%",1)
endif
if bb==1
BoxDataClear(2,"APPLE")
gosub randcolor
BoxPen(2,"%r%,%g%,%b%",1)
bb=0
endif
BoxDrawLine(2,"%p1%,%p2%,%p3%,%p4%")
bb=0
for q=1 to 4
p%q%=p%q%+v%q%
if p%q% <= 0
p%q%=0
v%q%=Int(Random(10))+1
bb=1
endif
if p%q% >= 1000
p%q%=1000
v%q%=-Int(Random(10))-1
bb=1
endif
next
endwhile
BoxDestroy(2)
return
:DOBOXES
BoxCaption(1,"Random Rectangles")
BoxNew(2,"0,0,1000,1000",0)
BoxButtonDraw(2,8,"Exit","50,50,200,120")
BoxDataTag(2,"ACORN")
ErrorMode(@OFF)
while 1
if BoxButtonStat(2,8)==1 then break
x=Random(1000)
y=Random(1000)
s=Random(1000)
t=Random(1000)
r=Random(255)
g=Random(255)
b=Random(255)
BoxColor(2,"%r%,%g%,%b%",0)
BoxDrawRect(2,"%x%,%y%,%s%,%t%",2) ; Bug here on 1
if LastError()==10108
BoxDataClear(2,"ACORN")
BoxUpdates(1,3)
endif
endwhile
ErrorMode(@CANCEL)
BoxDestroy(2)
return
:DODOTS
BoxCaption(1,"Driving Me Dotty")
BoxNew(2,"0,0,1000,1000",0)
BoxButtonDraw(2,8,"Exit","50,50,200,120")
BoxColor(2,BLACK,0)
BoxDrawRect(2,"0,0,1000,1000",2)
brk=0
x=500
y=500
oldxx=0
oldyy=0
z=5
z2=10
BoxDataTag(2,"SAM")
while 1
BoxDataClear(2,"SAM")
gosub RandColor
BoxColor(2,"%r%,%g%,%b%",0)
for q=1 to 100
x1=x-z
x2=x+z
y1=y-z
y2=y+z
BoxDrawCircle(2,"%x1%,%y1%,%x2%,%y2%",2)
ww=Int(Random(100))
if ww>16
xx=oldxx
yy=oldyy
else
xx=ww&3
if xx==3 then xx=0
yy=(ww&12)>>2
if yy==3 then yy=0
endif
if x<=0 then xx=2
if x>=1000 then xx=1
if y<=0 then yy=2
if y>=1000 then yy=1
oldxx=xx
oldyy=yy
if xx==2 then x=x+z2
if xx==1 then x=x-z2
if yy==2 then y=y+z2
if yy==1 then y=y-z2
if BoxButtonStat(2,8)==1
brk=1
break
endif
next
if brk==1 then break
endwhile
BoxDestroy(2)
return
:DOTEXT
BoxCaption(1,"Fontopia")
BoxNew(2,"0,0,1000,500",0)
BoxColor(2,LTGRAY,2)
BoxColor(1,LTGRAY,0)
BoxButtonDraw(2,8,"Exit","50,50,200,200")
BoxDrawRect(2,"0,0,1000,1000",2)
BoxDrawRect(1,"0,500,1000,1000",2)
words="The quick brown fox went happy stroll dark woods looking for something tasty dinner soon found picnic basket full yummy goodies "
wc=ItemCount(words," ")
BoxTextColor(1,BLACK)
;;;;;;;;;
BoxTextFont(1,"",20,0,0)
BoxTextColor(1,RED)
BoxDrawText(1,"25,510,1000,545","Results shown will vary with installed fonts...",0,0)
BoxTextColor(1,BLACK)
fonttype=0
xxx=25
yyy=xxx+225
BoxTextFont(1,"",30,fonttype,0)
BoxDrawText(1,"%xxx%,550,%yyy%,600","Normal",0,0)
BoxTextFont(1,"Times New Roman",30,fonttype,4)
BoxDrawText(1,"%xxx%,625,%yyy%,675","Times New Roman",0,0)
BoxTextFont(1,"Arial",30,fonttype,8)
BoxDrawText(1,"%xxx%,700,%yyy%,750","Arial",0,0)
BoxTextFont(1,"Modern",30,fonttype,12)
BoxDrawText(1,"%xxx%,775,%yyy%,825","Modern",0,0)
BoxTextFont(1,"Script",30,fonttype,16)
BoxDrawText(1,"%xxx%,850,%yyy%,900","Script",0,0)
BoxTextFont(1,"Old English Text MT",30,fonttype,22)
BoxDrawText(1,"%xxx%,925,%yyy%,975","Old English",0,0)
fonttype=100
xxx=275
yyy=xxx+225
BoxTextFont(1,"",30,fonttype,0)
BoxDrawText(1,"%xxx%,550,%yyy%,600","Italic",0,0)
BoxTextFont(1,"Times New Roman",30,fonttype,4)
BoxDrawText(1,"%xxx%,625,%yyy%,675","Times New Roman",0,0)
BoxTextFont(1,"Arial",30,fonttype,8)
BoxDrawText(1,"%xxx%,700,%yyy%,750","Arial",0,0)
BoxTextFont(1,"Modern",30,fonttype,12)
BoxDrawText(1,"%xxx%,775,%yyy%,825","Modern",0,0)
BoxTextFont(1,"Script",30,fonttype,16)
BoxDrawText(1,"%xxx%,850,%yyy%,900","Script",0,0)
BoxTextFont(1,"Old English Text MT",30,fonttype,20)
BoxDrawText(1,"%xxx%,925,%yyy%,975","Old English",0,0)
fonttype=70
xxx=525
yyy=xxx+225
BoxTextFont(1,"",30,fonttype,0)
BoxDrawText(1,"%xxx%,550,%yyy%,600","Bold",0,0)
BoxTextFont(1,"Times New Roman",30,fonttype,4)
BoxDrawText(1,"%xxx%,625,%yyy%,675","Times New Roman",0,0)
BoxTextFont(1,"Arial",30,fonttype,8)
BoxDrawText(1,"%xxx%,700,%yyy%,750","Arial",0,0)
BoxTextFont(1,"Modern",30,fonttype,12)
BoxDrawText(1,"%xxx%,775,%yyy%,825","Modern",0,0)
BoxTextFont(1,"Script",30,fonttype,16)
BoxDrawText(1,"%xxx%,850,%yyy%,900","Script",0,0)
BoxTextFont(1,"Old English Text MT",30,fonttype,20)
BoxDrawText(1,"%xxx%,925,%yyy%,975","Old English",0,0)
fonttype=170
xxx=775
yyy=xxx+225
BoxTextFont(1,"",30,fonttype,0)
BoxDrawText(1,"%xxx%,550,%yyy%,600","Bold Italic",0,0)
BoxTextFont(1,"Times New Roman",30,fonttype,4)
BoxDrawText(1,"%xxx%,625,%yyy%,675","Times New Roman",0,0)
BoxTextFont(1,"Arial",30,fonttype,8)
BoxDrawText(1,"%xxx%,700,%yyy%,750","Arial",0,0)
BoxTextFont(1,"Modern",30,fonttype,12)
BoxDrawText(1,"%xxx%,775,%yyy%,825","Modern",0,0)
BoxTextFont(1,"Script",30,fonttype,16)
BoxDrawText(1,"%xxx%,850,%yyy%,900","Script",0,0)
BoxTextFont(1,"Old English Text MT",30,fonttype,20)
BoxDrawText(1,"%xxx%,925,%yyy%,975","Old English",0,0)
BoxDataTag(2,"PEACHY")
brk=0
cnt=0
wash=0
while 1
for i=1 to wc
cnt=cnt+1
gosub randcolor
BoxTextColor(2,"%r%,%g%,%b%")
;gosub randcolor
;BoxColor(2,"%r%,%g%,%b%",0)
x=Random(800)
y=Random(800)
s=x+Random(200)
t=y+Random(200)
fontsize=max(10,min(t-y,Random(200)))
BoxTextFont(2, "", fontsize, 10+Random(80)+ (100*Int(Random(1))), (Int(Random(4)+1)*4 ))
BoxDrawText(2,"%x%,%y%,%s%,%t%",ItemExtract(i,words," "),0,0)
if BoxButtonStat(2,8)
brk=1
break
endif
if cnt==200
cnt=0
wash=wash+1
if wash==8 then wash=0
BoxColor(2,"%r%,%g%,%b%",wash)
BoxDrawRect(2,"0,0,1000,1000",2)
endif
next i
BoxDataClear(2,"PEACHY")
if brk then break
endwhile
BoxDestroy(2)
return
:DOTHERM
rectutext="100,100,1000,900"
rectTherm="200,350,800,650"
rectButton="0,0,100,100"
;rectThermDone='"100,550,%%xxx%%,800"'
;rectThermLeft='"%%xxx%%,550,900,800"'
rectThermLine1="100,550,900,550"
rectThermLine2="900,550,900,800"
rectThermLine3="900,800,100,800"
rectThermLine4="100,800,100,550"
ThermPenWidth=20
rectThermText1="100,50,1000,199"
rectThermPercent="490,625,550,725"
rectTopHalf="0,0,1000,210"
rectBotHalf="0,210,1000,1000"
rectTitle="100,50,900,200"
rectTitleText="10,10,790,140"
TitleHeight=950
rectNote="250,850,750,925"
NoteHeight=400
rectNoteText="70,200,950,800"
rectnoteline1="0,0,1000,0"
rectNoteline2="1000,1000,1000,0"
rectNoteLine3="0,1000,1000,1000"
rectNoteLine4="0,0,0,1000"
notepenwidth=120
rectnoteline1b="40,150,960,150"
rectNoteline2b="960,840,960,150"
rectNoteLine3b="40,840,960,840"
rectNoteLine4b="40,150,40,840"
notepenwidthb=50
wbid=2
Thermid=3
Noteid=4
; Make main window look nice
BoxColor(1,"128,0,0",1)
BoxDrawRect(1,"0,0,1000,1000",2)
BoxCaption(1,"Are we making any progress here?")
;Get title on screen
BoxNew(wbid,rectTitle,1)
BoxColor(wbid,BLACK,0)
BoxDrawRect(wbid,"0,0,1000,1000",2)
BoxTextFont(wbid,"Arial",TitleHeight,170,0) ; san-srif, ariel, size 20, bold, noitalic
BoxTextColor(wbid,RED)
BoxDrawText(wbid,rectTitleText,"Acme Aardvarks",0,32)
;Do note box
BoxNew(Noteid,rectNote,1)
BoxColor(Noteid,LTGRAY,0) ; Light Gray no gradient
BoxDrawRect(Noteid,"",2)
BoxTextFont(Noteid,"Arial",NoteHeight,0,0) ; san-srif, ariel, size 12, nobold, noitalic
;BoxTextRect(Noteid,rectNoteText)
BoxTextColor(Noteid,RED)
BoxPen(Noteid,WHITE,notepenwidth)
boxdrawline(Noteid,rectNoteLine1)
boxdrawline(Noteid,rectNoteLine4)
BoxPen(Noteid,GRAY,notepenwidth)
boxdrawline(Noteid,rectNoteLine2)
boxdrawline(Noteid,rectNoteLine3)
BoxPen(Noteid,WHITE,notepenwidthb)
boxdrawline(Noteid,rectNoteLine2b)
boxdrawline(Noteid,rectNoteLine3b)
BoxPen(Noteid,GRAY,notepenwidthb)
boxdrawline(Noteid,rectNoteLine1b)
boxdrawline(Noteid,rectNoteLine4b)
BoxDataTag(Noteid,"NOTE")
;BoxDataClear(Noteid,"NOTE")
BoxDrawText(Noteid,rectNoteText,"Initializing...",1,4)
;Draw thermoneter outline
BoxNew(Thermid,rectTherm,2)
BoxUpdates(Thermid,0)
BoxCaption(Thermid,"Acme Aardvark Association")
BoxColor(Thermid,LTGRAY,0)
BoxDrawRect(Thermid,"",2)
; Draw updating thermometer here
; there are 3 virtual pixels per percent
; we have to draw 3 boxes and some text...
BoxDataTag(Thermid,"FRED")
BoxCaption(Thermid,"Please wait. Function in progress")
FilesToCopy=16
FilesCopied=0
for FilesCopied=1 to FilesToCopy
BoxDataClear(Thermid,"FRED")
BoxUpdates(Thermid,0)
BoxColor(Thermid,GREEN,0)
xxx= 100+((800*FilesCopied)/FilesToCopy)
per=(100.0*FilesCopied)/FilesToCopy
per=Int(per)
;rectThermDone='"100,550,%%xxx%%,800"'
;rectThermLeft='"%%xxx%%,550,900,800"'
BoxDrawRect(Thermid,"104,554,%xxx%,796",2)
BoxColor(Thermid,GRAY,0)
BoxDrawRect(Thermid,"%xxx%,554,896,796",2)
BoxPen(Thermid,BLACK,ThermPenWidth)
boxdrawline(Thermid,rectThermLine1)
boxdrawline(Thermid,rectThermLine2)
boxdrawline(Thermid,rectThermLine3)
boxdrawline(Thermid,rectThermLine4)
if per<50 then BoxTextColor(Thermid,WHITE)
BoxDrawText(Thermid,rectThermPercent,"%per%%%",0,0)
BoxTextColor(Thermid,BLACK)
BoxColor(Thermid,LTGRAY,0)
BoxDrawText(Thermid,rectThermText1,"Mooshing Object number %FilesCopied%",1,0)
BoxDataClear(NoteId,"NOTE")
BoxDrawText(Noteid,rectNoteText,"Working on Object number %FilesCopied%",1,4)
BoxUpdates(Thermid,2)
TimeDelay(Random(1.0)) ;Fake passage of time
next
Message("Acme Aardvark Association","Mooshing Complete!!")
BoxDestroy(wbid)
BoxDestroy(Thermid)
BoxDestroy(Noteid)
return
:RANDCOLOR
r=Int(Random(255))
g=Int(Random(255))
b=Int(Random(255))
q=min(r,g,b)
if q==r then r=0
if q==g then g=0
if q==b then b=0
q=max(r,g,b)
if q==r then r=255
if q==g then g=255
if q==b then b=255
return